package com.dimension.controller;

import com.dimension.pojo.Address;
import com.dimension.pojo.AddressExample;
import com.dimension.service.AddressService;
import com.dimension.service.impl.AddressServiceImpl;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;


import java.util.List;


@Controller
@RequestMapping("/address")
public class AddressController {
    @Autowired
    @Qualifier("addressServiceImpl")
    private AddressService addressService;


    @GetMapping("/add")
    public String add(Model model){
        AddressExample addressExample = new AddressExample();
        List<Address> addresses = addressService.selectByExample(addressExample);
        model.addAttribute("list",addresses);
        return  "newjsp";
    }



}